public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.levelOrder(root);
        System.out.println();
        if(binaryTree.isCompleteTree(root)){
            System.out.println("是完全二叉树");
        }else{
            System.out.println("不是");
        }
    }
    public static void main2(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("=========================");

        binaryTree.inOrder(root);
        System.out.println();
        System.out.println("=========================");

        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("=========================");

        binaryTree.size(root);
        System.out.println("结点的个数："+binaryTree.nodeSize);

        System.out.println("结点的个数："+binaryTree.size2(root));

        binaryTree.getLeafNodeCount1(root);
        System.out.println("叶子结点的个数："+binaryTree.leafSize);

        System.out.println("叶子结点的个数："+binaryTree.getLeafNodeCount2(root));

        System.out.println("第K层节点的个数:"+binaryTree.getKLevelNodeCount(root,4));

        System.out.println("获取二叉树的高度:"+binaryTree.getHeight(root));

        if(binaryTree.find(root,'B')!=null){
            System.out.println("找到了");
        }else {
            System.out.println("没找到");
        }

        binaryTree.levelOrder(root);
    }
}
